import 'package:flutter/material.dart';

class TestHomePage1 extends StatelessWidget {
  final String title;

  const TestHomePage1({super.key, this.title = ''});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('首页'),
        leading: IconButton(
          onPressed: () {
            //关闭
            Navigator.of(context).pop();
          },
          icon: Icon(Icons.close),
        ),
      ),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text('内容主题  $title'),
            SizedBox(height: 40),
            OutlinedButton(
              onPressed: () {
                //
                String name = '张三';
                Navigator.of(context).pop(name);
              },
              child: Text("关闭 传参数"),
            ),
          ],
        ),
      ),
    );
  }
}
